<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>10</title>
</head>
<body>
<script>
    //统计[1,100]之间有多少个质数
    var count=0;
    for (let i = 2; i <=100; i++) {
        var flag=true;
        for (let j = 2; j*j <=i; j++) {
            if (i%j==0){
                flag=false;
                break;
            }
        }
        if (flag){
            count++;
        }
    }
    console.log("[1,100]间的质数有"+count+"个");
</script>
</body>
</html>